CREATE OR REPLACE PACKAGE "kesplus_app"."kes_plus_pkg_sys_version" AUTHID CURRENT_USER AS
    TB_NAME CONSTANT VARCHAR := 'kes_sys_version';
    PK_COLUMN_NAME CONSTANT VARCHAR := 'id';
    COLUMN_DELETED CONSTANT VARCHAR := 'isDeleted';
    COLUMN_STATUS CONSTANT VARCHAR := 'versionStatus';
    COLUMN_TYPE CONSTANT VARCHAR := 'versionType';
    COLUMN_EFFECT_TIME CONSTANT VARCHAR := 'effectTime';
    function add_one(jsonData varchar, id_ varchar DEFAULT NULL) return varchar;
    procedure update_by_id(jsonData varchar);
    procedure delete_by_id(id_ varchar);
    procedure logical_delete_by_id(id_ varchar);
    procedure deprecate_by_id(id_ varchar);
    procedure effect_by_id(id_ varchar);
    procedure change_2_uat(id_ varchar);
    procedure change_2_dat(id_ varchar);
    function list_by_type(versionType int) return json;
    function get_by_id(id_ varchar) return json;
    FUNCTION get_type_by_version(versionCode varchar) return int;
    procedure check_unique(jsonData varchar);
    procedure check_exist(jsonData varchar);
    FUNCTION get_time_stamp() RETURN bigint;
end;

CREATE OR REPLACE PACKAGE BODY "kesplus_app"."kes_plus_pkg_sys_version" AS WRAPPED
CH9bBmQt1yXskhgXW+5qP8zOyzjbyParfTRNqxovk8010LK2ZvuRVthoEsXF
qCMbba37Lq0TR1zMkc8hw3C797S/IpxCaqADwLvBFoAc3rtlOoDsw2Htwv3i
sZ0P2LAK828X1lwiC83C5s673ebyQCN2tQU5puVG1y5cH3mqMS2qFxriyWUD
vIUNMbFA9wlczP0cUAOXC9/dLktPTDjP8wSELzxzRuOLtjN88S87GPmzXoNI
4dbsSnKA6i9eDrVc2TsIh8kxmDe0Qr5+nqWYnFhrCJE2y9X8CRXoPq7kZHn8
DH1jrq4IPHTvc+JaHTMTlerknDNJLk+HkoUXQM6gqqNaZwbJQujhQ+3kTBso
sf9lWA3VPLxafjwXoBNshIATOQ8FCKW2wvw9LKCWGRUGJIDy3LacOIs2BlOl
gyL/bJ2mDt8Lw1G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